<?php

namespace App\Console\Commands;

use App\Console\Commands\Common\CommonCommand;
use Illuminate\Support\Facades\Artisan;
use Kkokk\Poster\PosterManager;

class CreateQr extends CommonCommand
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'qr {id}';


    /*
     * http://www.520yummy.com/composer/poster/doc.html
     * 外部调用例子
     * Artisan::call('qr',['id'=>1]);
     * $res = Artisan::output();
     * dump($res);
     *
     * */


    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle() {

        /*$text = $this->argument('text');
        $imgName = time().uniqid().'.png';
        $subPath = "qr/$imgName";
        if(file_exists(public_path($subPath))){
            $this->info(url($subPath));
            return 0;
        }
        $qr = PosterManager::Poster()->Qr($text,$subPath);
        $this->info(url($subPath));*/
        return 0;
    }
}
